﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Model.Catalog;
using OnlineFloralShop.Product;

namespace OnlineFloralShop
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            GetProductsBestSeller();
            GetAllProducts();
        }


        //-----------------------------------------------------------------//
        //Bind all product Lastest Products
        void GetAllProducts()
        {
            ListView_Home.DataSource = Model.Catalog.Product.GetAllProducts("DateAdded DESC");
            ListView_Home.DataBind();
        }

        void GetProductsBestSeller()
        {
            ListView_BestSeller.DataSource = Model.Catalog.Product.GetProductsBestSell();
            ListView_BestSeller.DataBind();
        }
        
    }
}
